/**
 *
 * @author 
 *
 */
class SceneManager extends egret.Sprite
{
	public constructor() {
    	super();
    	
    	this.init();
	}
	
    public static mInstance:SceneManager;
	
    public static getInstance(): SceneManager
	{
	    if(SceneManager.mInstance == null)
        {
            SceneManager.mInstance  = new SceneManager;
        }
        
        return SceneManager.mInstance;
	}
	
	public mySelf:ScenePlayer;
    public map:GameMap;
	
    private init():void
    {
        
        this.map = new GameMap;
        this.addChild(this.map);
        
        this.mySelf = new ScenePlayer;
        this.mySelf.x = 200;
        this.mySelf.y = 200;
        this.addChild(this.mySelf);
        
        this.mySelf.setStyle(1 + "");
        
        this.touchEnabled = true;
        
        this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.thisClick, this);
        
    }
    
    private thisClick(e:egret.TouchEvent):void
    {
        ControlManager.getInstance().doMove(e.localX, e.localY);
    }
}
